package demo2;

class Base {
    int a = 1;
    int b = 2;
}
public class Derived extends Base{
    int a = 100;
    int b = 4;
    int c = 3;

    public void test(){
        System.out.println(super.a);
        System.out.println(this.b);//此时这个b就是Derived类里面的b = 4
        System.out.println("======");
        System.out.println(super.b);//此时这个b就是Derived的父类Base类里面的b = 2
        System.out.println(this.c);
    }
    public static void main(String[] args) {
        Derived derived = new Derived();
        derived.test();
    }
}
